import request from '@/utils/request'

// 获取题目列表
export const getQuestionList = (params) => {
  return request({
    url: `/v1/test/topic`,
    method: 'GET',
    params
  })
}

// 创建题目
export const createQuestion = (data) => {
  return request({
    url: `/v1/test/topic`,
    method: 'POST',
    data
  })
}

// 修改题目
export const modifyQuestion = (data) => {
  return request({
    url: `/v1/test/topic`,
    method: 'PUT',
    data
  })
}

// 删除题目
export const deleteQuestion = (params) => {
  return request({
    url: `/v1/test/topic`,
    method: 'DELETE',
    params
  })
}

// 删除答案
export const deleteAnswer = (params) => {
  return request({
    url: `/v1/test/topicContent`,
    method: 'DELETE',
    params
  })
}

// 批量删除题目
export const batchDeletionTestQusetion = (data) => {
  return request({
    url: `/v1/test/topics`,
    method: 'DELETE',
    data
  })
}

// question_type_id
export const getTpyeId = (params) => {
  return request({
    url: `/v1/test/question/type`,
    method: 'GET',
    params
  })
}

// 获取考试列表
export const getTestPaper = (params) => {
  return request({
    url: `/v1/test/paper`,
    method: 'GET',
    params
  })
}

// 获取答题记录
export const examRecord = (params) => {
  return request({
    url: `/v1/test/history/quiz/all`,
    method: 'GET',
    params
  })
}

// 修改或创建答案
export const modifyOrCreateAnswer = (data) => {
  return request({
    url: `/v1/test/topicContent`,
    method: 'PUT',
    data
  })
}

// 创建试卷
export const setUpPaper = (data) => {
  return request({
    url: `/v1/test/paper`,
    method: 'POST',
    data
  })
}

// 删除试卷
export const deletePaper = (params) => {
  return request({
    url: `/v1/test/paper`,
    method: 'DELETE',
    params
  })
}

// 修改题目类型分数

export const modifyQuestionScore = (data) => {
  return request({
    url: `/v1/test/TypeScore`,
    method: 'PUT',
    data
  })
}

// 修改试卷
export const modifyPaper = (params) => {
  return request({
    url: `/v1/test/paper`,
    method: 'PUT',
    params
  })
}
